package com.example.dqnm.controller;

import com.example.dqnm.pojo.ProductsList;
import com.example.dqnm.pojo.ajaxResult;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.example.dqnm.service.categoryService;

import java.util.List;

@RequiredArgsConstructor
@RestController
@RequestMapping("/category")
public class categoryController {
    @Autowired
    private categoryService categoryService;

    @GetMapping("/findAllcategory")
    private ajaxResult<List<ProductsList>> findAllcategory() {
        List<ProductsList> array = categoryService.findAllcategory();
        return new ajaxResult<>(array);
    }


}
